package com.hyp.controller;

import com.hyp.pojo.Result;
import com.hyp.service.CartService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Slf4j //显示日志消息
@RestController
@RequestMapping("/wx/")
public class CartController {
    @Autowired
    private CartService cartService;

    //加入购车
    @PostMapping("/addcart/{userId}/{productId}")
    public Result addcart(@PathVariable Integer userId, @PathVariable Integer productId) {
        cartService.addcart(userId, productId);
        return Result.success();
    }
}
